/**
 * 请假套件
 */
export const leaveChildren = [
    {
        label: '请假类型',
        formId: 'leaveType',
        tag: 'LeaveType',
        isSummary: true,
        rules: [
            {
                required: true,
                message: '请选择请假类型'
            }
        ],
        options: {
            disabled: true,
            placeholder: '请假类型'
        },
        proCondition: true,
        isUsed: false,
        conditionShowOption: { valueMode: 'multiple', showType: 'select', fetchType: 'leave' }
    },
    {
        label: '开始时间',
        formId: 'startTime',
        tag: 'LeaveDatePicker',
        isSummary: true,
        rules: [
            {
                required: true,
                message: '请选择开始时间'
            }
        ],
        options: {
            disabled: true,
            placeholder: '请选择开始时间'
        }
    },
    {
        label: '结束时间',
        formId: 'endTime',
        tag: 'LeaveDatePicker',
        isSummary: true,
        rules: [
            {
                required: true,
                message: '请选择结束时间'
            }
        ],
        options: {
            disabled: true,
            placeholder: '请选择结束时间'
        }
    },
    {
        label: '时长',
        formId: 'duration',
        tag: 'Duration',
        autofill: true,
        rules: [
            {
                required: true,
                message: '时长不能为空'
            }
        ],
        options: {
            disabled: true,
            placeholder: '时长'
        },
        proCondition: true,
        isUsed: false,
        conditionShowOption: { showType: 'number', numberProps: { min: 0 } },
        inFormAuth: false
    },
    {
        label: '请假原因',
        formId: 'reason',
        tag: 'TextArea',
        rules: [
            {
                required: true,
                message: '请输入请假原因'
            }
        ],
        options: {
            disabled: true,
            placeholder: '请输入请假原因'
        }
    },
    {
        label: '附件',
        formId: 'OssUpload',
        tag: 'OssUpload',
        type: 'OssUpload',
        key: 'OssUpload',
        options: {},
        cmpType: 'common',
        tagIcon: 'iconprocess_common_annex_icon1',
        action: '/api/resource/public/oss/producePutPreSignUrls',
        rules: [],
        name: 'file',
        buttonText: '点击上传附件',
        fileSize: 20,
        sizeUnit: 'MB',
        proCondition: false,
        uploadProps: {
            multiple: true, // 多文件
            dragAble: false, // 是否为拖拽上传
            checkFileSize: 0, // 限制单文件上传最大值，单位为MB
            checkFileType: '', // 允许上传的文件格式
            maxCount: 10, // 上传的文件个数上限
            help: null // 帮助文案
        }
    }
];

export const leaveControl = {
    label: '请假申请',
    cmpType: 'custom',
    formId: '',
    key: 'Leave',
    tag: 'Leave',
    tagIcon: 'iconprocess_common_askleave_supervisor_icon',
    children: leaveChildren,
    proCondition: true,
    isUsed: false
};
